package designPattern.command.undoCommand
{
	public class UndoCommand extends CommandWithUndo
	{
		public function UndoCommand()
		{
			super();
		}
		
		override public function execute():void
		{
			if(aCommandList.length)
			{
				var lastCommand:CommandWithUndo = aCommandList.pop();
				lastCommand.undo();
			}
		}
		
		//undo本省不能执行undo
		override public function undo():void
		{
			throw new Error("Can not execute!");
		}
	}
}